@echo off

setlocal enabledelayedexpansion

set dbuser=ls34_coreandsp_init
set dbpwd=ls34_coreandsp_initpwd
set tnsname=o30g4

set info_m=
set /a ret=0

mkdir ..\exp_dump_file

set NLS_LANG=AMERICAN_AMERICA.UTF8

if not exist ..\version_list.txt (
  echo version.txt not exist, no version info, please check again.
  goto err_1
)


@FOR /F "skip=13" %%i in (version.txt) do (
echo %%i


if not exist ..\exp_dump_file\install.dmp (
  echo ..\exp_dump_file\install.dmp does not exist, maybe dump dose not execute, plase check it.
  goto err_1
)

if exist ..\exp_dump_file\initial_dmp.zip del ..\exp_dump_file\initial_dmp.zip

zip -j ..\exp_dump_file\initial_dmp.zip ..\exp_dump_file\install.dmp


mkdir ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump

if not exist ..\exp_dump_file\initial_dmp.zip (
  echo ..\exp_dump_file\initial_dmp.zip does not exist, maybe zip dump dose not execute, plase check it.
  goto err_1
)


if exist ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump\initial_dmp.zip del ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump\initial_dmp.zip
copy ..\exp_dump_file\initial_dmp.zip ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump /y


if not exist ..\exp_dump_file\LOB_TYPE_DDL.sql (
  echo ..\exp_dump_file\LOB_TYPE_DDL.sql does not exist, maybe LOB_TYPE_DDL dose not execute, plase check it.
  goto err_1
)

if exist ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump\LOB_TYPE_DDL.sql del ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump\LOB_TYPE_DDL.sql
copy ..\exp_dump_file\LOB_TYPE_DDL.sql ..\exp_dump_file\INIT_DB_BACKUP_TEMP\%%i\initial_dump /y

goto outloop
)

:outloop

:succ_1
echo log check  completed ... ...
set info_m=without errors.
set /a ret=100
goto finish

:err_1
echo has errors.
set info_m=with errors.
set /a ret=-100

:finish
echo finish !info_m!

exit !ret!

endlocal


